<%@page import="com.wlw.entity.User"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String root = request.getSession().getServletContext().getRealPath("/");
	User user = (User)request.getSession().getAttribute("user");
	String province = "";
	String city = "";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>foreground/"/>
<meta http-equiv="Content-Type" content="text/html;" />
<title>个人中心- 开溜儿网</title>
<link type="text/css" rel="stylesheet" href="css/style.css"/>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.scrollfollow.js"></script>
<script type="text/javascript" src="js/flash.js"></script>
<script type="text/javascript" src="js/int.js"></script>
<script src="js/CJL.0.1.min.js"></script>
<script src="js/AlertBox.js"></script>
<script type="text/javascript">
_current = 0 ;
function _sel(_n){
	if(_current!=_n){
		document.getElementById('recommend_'+_current).style.display = 'none';
		document.getElementById('recommend_'+_n).style.display = '';
		document.getElementById('recommend_href_'+_current).className = '';
		document.getElementById('recommend_href_'+_n).className = 'current';
		_current = _n ;	
	}

}
</script>
<style>
	table tr {padding:20px;}
	table tr td{padding:10px;}
</style>

<!-- 我的游记： -->
<style type="text/css"> 
th { 
font: bold 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
color: #4f6b72; 
border-right: 1px solid #C1DAD7; 
border-bottom: 1px solid #C1DAD7; 
border-top: 1px solid #C1DAD7; 
letter-spacing: 2px; 
text-transform: uppercase; 
text-align: left; 
padding: 6px 6px 6px 12px; 
background: #CAE8EA no-repeat; 
} 
td { 
border-right: 1px solid #C1DAD7; 
border-bottom: 1px solid #C1DAD7; 
background: #fff; 
font-size:14px; 
padding: 6px 6px 6px 12px; 
color: #4f6b72; 
} 
td.alt { 
background: #F5FAFA; 
color: #797268; 
} 
th.spec,td.spec { 
border-left: 1px solid #C1DAD7; 
} 
/*---------for IE 5.x bug*/ 
html>body td{ font-size:14px;} 
tr.select th,tr.select td 
{ 
background-color:#CAE8EA; 
color: #797268; 
} 
</style> 
</head>
<body>
<div id="topBar">
	<div class="wrapper">
		<div class="l">游客您好，欢迎访问兴文旅游资讯网！</div>
	</div>
</div>
	<div id="header">
		<div class="wrapper">
			<div class="logo">
				<a href="<%=path%>"><img src="images/logo.png">
				</a>
			</div>
				<div class="search">
					<dl>
						<dd>
							<a id="search_type1"
								onclick="select_search_type(1);return false;" href="#"
								class="current">景点</a>
						</dd>
						<dd>
							<a id="search_type2"
								onclick="select_search_type(2);return false;" href="#">城市</a>
						</dd>
						<dd>
							<a id="search_type3"
								onclick="select_search_type(3);return false;" href="#">问答</a>
						</dd>
					</dl>
					<div>
						<input id="s" type="text" style="height: 35px;padding-left: 25px;" name="search"
							onfocus="if(this.value=='这是一个神奇的搜索'){this.value='';}"
							value="这是一个神奇的搜索" style="padding: 10;"/><input
							name="search_type" id="search_type" value="1" type="hidden" />
							<script type="text/javascript">
								function search(){
									var s = document.getElementById("s").value;
									var type = document.getElementById('search_type').value;
									var uri = encodeURI(encodeURI(s));
									window.location.href='${pageContext.request.contextPath}/user/search.do?search='+uri+'&search_type='+type;
								}
							</script>
							
						<button type="submit"  onclick="search();">搜索</button>
					</div>
				</div>
		</div>
	</div>
	<div id="nav">
		<dl>
			<div>
				<label id="location"></label>
			   <script type="text/javascript">
			   //通过新浪地址库获得地址。
			   
					document.getElementById("location").innerHTML="您当前的位置："+remote_ip_info["province"]+"省"+"|"+remote_ip_info["city"] + "市";
			   </script>
			</div>
			<dd>
				<a href="<%=path%>/travalNoteManage/listTravalNote.do" target="_blank" class="a2">全部游记</a>
			</dd>
			<dd>
				<a href="<%=path%>/foreground/fabiaoyoujis.jsp" target="_blank" class="a3">发表游记</a>
			</dd>
		</dl>
		<ul>
			<li><a href="<%=path%>/" class="a1">首页</a>
			</li>
			<li><a href="<%=path%>/travalNoteManage/traval.do" class="a2">旅游攻略</a>
			</li>
			<li><a href="<%=path%>/city/list.do" class="a4">目的地</a>
			</li>
			<li><a href="<%=path%>/city/laLongutitude.do" class="a6">地图</a>
			</li>
			<li><a href="<%=path%>/qaManage/quest.do?pageNo=1" class="a5">问答</a>
			</li>
			<li><a href="<%=path%>/user/myInfo.do" class="a7">个人中心</a>
			</li>
		</ul>
	</div>
<script type="text/javascript">
function select_search_type(n){
	document.getElementById('search_type1').className='';
	document.getElementById('search_type2').className='';
	document.getElementById('search_type3').className='';
	document.getElementById('search_type'+n).className='current';
	document.getElementById('search_type').value=n;
}
</script><div id="main">
	<div id="page">
		<div class="pageLeft">
			<h2 class="t2">个人中心</h2>
			<div class="subNav">
				<div>
					<ul>
						<li><a href="javascript:void(0)" onclick="document.getElementById('myInfo').scrollIntoView();">个人资料</a></li>
   						<li><a href="javascript:void(0)" onclick="document.getElementById('myFoot').scrollIntoView();">我的足迹</a></li>
   						<li><a href="javascript:void(0)" onclick="document.getElementById('myTraval').scrollIntoView();">我的游记</a></li>
					</ul>
				</div>			
			</div>
			<div class="ad">
				<a href="#"><img src="images/ad1.jpg" /></a>
			</div>
		</div>		
		<div class="pageRight">
			<div class="zhuMain" style="background: #A0E6FF;">
				<div class="itemA">
					<h3><a id="myInfo">热点推荐</a></h3>
						<style>
							.lightbox{width:500px;background:#FFFFFF;border:5px solid #0051c1;line-height:20px;display:none; margin:0;}
							.lightbox dt{background-color: #0051c1;padding:5px;}
							.lightbox dd{ padding:20px; margin:0;}
							
						</style>

						<input type="button" value="修改资料" id="idCenter" style="background:url(../images/header_bg3.gif) no-repeat; border:0; width:72px; height:28px; float:right; margin-top:2px; color:#fff; font-weight:bold; font-size:14px; cursor:pointer"/> <span id="idMsg"></span> 
						<br />
						<dl id="idBox" class="lightbox" style="top:10%;left:5%;">
							<dt>
								<b>个人资料</b>
								<input style="float:right; background-color: #0051c1;border: 0px red solid;" type="button" value="X" id="idBoxClose"/>
							</dt>
						<center>
							<dd>
								<form action="<%=path%>/user/modMyInfo.do" method="post" enctype="multipart/form-data">
									<table>
										<tr>
											<td>头像：</td>
											<td><img width="80px" height="80px"
												src="<%=path%>/${u.headPortrait}" />
											</td>
										</tr>
										<tr>
											<td>头像上传：</td>
											<td><input name="myfile" type="file">
											</td>
										</tr>
										<tr>
											<td>用户名：</td>
											<td>
												<input type="hidden" name="id" value="${u.id}"/>
												<input type="text" name="uname" value="${u.uname}" id="idBoxTxt">
											</td>
										</tr>
										<tr>
											<td>密&nbsp;&nbsp;&nbsp;码：</td>
											<td><input type="password"  name="pwd" value="" id="idBoxTxt">
											</td>
										</tr>
										<tr>
											<td>确认密码：</td>
											<td><input type="password" value="" id="idBoxTxt">
											</td>
										</tr>
										<tr>
											<td>性&nbsp;&nbsp;&nbsp;别：</td>
											<td><input type="text" name="sex" value="${u.sex}" id="idBoxTxt">
											</td>
										</tr>
										<tr>
											<td>E-mail：</td>
											<td><input type="text" name="email" value="${u.email}" id="idBoxTxt">
											</td>
										</tr>
										<tr>
											<td>电&nbsp;&nbsp;&nbsp;话：</td>
											<td><input type="text"  name="telPhone" value="${u.telPhone}"
												id="idBoxTxt">
											</td>
										</tr>
									</table>
									<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
									<input type="submit" value=" 确定 "/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
								</form>
							</dd>
						</center>
						</dl>
						<script>
							(function(){
							
							var ab = new AlertBox("idBox"), lock = false;
							
							//锁定键盘
							function lockup(e){ e.preventDefault(); }
							//高亮层不锁定
							function lockout(e){ e.stopPropagation(); }
							
							ab.onShow = function(){
								$$("idBoxTxt").select();
								if ( lock ) {
									$$E.addEvent( document, "keydown", lockup );
									$$E.addEvent( this.box, "keydown", lockout );
									OverLay.show();
								}
							}
							ab.onClose = function(){
								$$("idMsg").innerHTML = $$("idBoxTxt").value;
								$$E.removeEvent( document, "keydown", lockup );
								$$E.removeEvent( this.box, "keydown", lockout );
								OverLay.close();
							}
							
							$$("idBoxClose").onclick = function(){ ab.close(); }
							
							$$("idCenter").onclick = function(){
								ab.center = true;
								ab.show();
							}
							})()
						</script> 
						<style>
						#t1{background-color: #a0e6ff; font-weight: bold;}
						#t2{background-color: #a0e6ff;}
						</style>
							<table style="background-color: #a0e6ff">
								<tr>
									<td id="t1">头像：</td>
									<td id="t2"><img style="width:80px;height:80px;" src="<%=path%>/${u.headPortrait}"/></td>
								</tr>
								<tr>
									<td id="t1">用户名：</td>
									<td id="t2">${u.uname}</td>
								</tr>
								<tr>
									<td id="t1">性别：</td>
									<td id="t2">${u.sex}</td>
								</tr>
								<tr>
									<td id="t1">E-mail：</td>
									<td id="t2">${u.email}</td>
								</tr>
								<tr>
									<td id="t1">手机：</td>
									<td id="t2">${u.telPhone}</td>
								</tr>
							</table>
				</div>
			</div>		
			
			<div class="zhuMain" style="background: #A0E6FF;">
				<div class="itemA">
					<h3 id="myFoot">热点推荐</h3>
						我的足迹
						<table id ="t1" class="table" cellspacing="0" style="width:100%;">
							<tr>
								<th class="spec">序号</th>
								<th>游记名称</th>
								<th>点赞数</th>
								<th>所在城市</th>
							</tr>
							<c:forEach items="${getUserTravalNotes}" var="ut" varStatus="ind">
								<c:if test="${(ind.index+1)%2 eq 1}">
									<tr>
										<td class="spec">${ind.index+1}</td>
										<td>${ut.title}</td>
										<td>${ut.zanCount}</td>
										<td class="alt">${ut.city.name}</td>
									</tr>
								</c:if>
								<c:if test="${(ind.index+1)%2 eq 0}">
									<tr class="select">
										<td class="spec">${ind.index+1}</td>
										<td>${ut.title}</td>
										<td class="alt">${ut.zanCount}</td>
										<td>${ut.city.name}</td>
									</tr>
								</c:if>
							</c:forEach>
						</table>
					</div>
			</div>	
			
				<div class="zhuMain" style="background: #A0E6FF;">
				<div class="itemA">
					<h3><a id="myTraval" name="#myTraval">热点推荐</a></h3>
						我的游记
						<table id ="t1" class="table" cellspacing="0"  style="width:100%;">
							<c:forEach items="${getUserTravalNotes}" var="ut" varStatus="ind">
								<tr>
									<td colspan="2" style="font-size: 16px;color:blue;"><span style="width:80px;height:61px; font-weight: bold;font-size: 14px;">标题：</span><a href="#" style="font-size:16px;color:#000aFF;">${ut.title}</a><span style="float: right;font-size:12px;">${ut.time}</span></td>
								</tr>
								<tr>
									<td colspan="2" style="color:black;font-size: 14px;">${ut.content}</td>
								</tr>
							</c:forEach>
						</table>
					</div>
			</div>	
		</div>
		<div class="clearit"></div>	
	</div>
		<div id="footer">
		<div class="nav">
			<ul>
            					<li><a href="#" target="_blank">关于我们</a></li>
                				<li><a href="#" target="_blank">广告服务</a></li>
                				<li><a href="#" target="_blank">联系方式</a></li>
                				<li><a href="#" target="_blank">网站声明</a></li>
                				<li><a href="#" target="_blank">诚聘英才</a></li>
                				<li><a href="#" target="_blank">合作伙伴</a></li>
                				<li><a href="#">返回顶部</a></li>
			</ul>
		</div>
		<div class="copyright">
			<div class="l">


</body>
</html>
